package groupb6.shopsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import groupb6.shopsystem.pojo.entity.Store;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StoreMapper extends BaseMapper<Store> {
    /**
     * 通过seller id 获取店铺信息
     * @param sellerId 卖家id
     *
     */
    @Select("select * from tb_store where seller_id = #{sellerId};")
    Store getStoreBySellerId(Integer sellerId);

    @Select("select * from tb_store where status = ${status};")
    List<Store> getStoreByStatus(Integer status);

    @Select("select * from tb_store;")
    List<Store> getAllStores();
}
